unit UModeloPesquisaRelatorio;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Buttons, CheckLst, ExtCtrls, UDPTOUteis;

type
  TFModeloPesquisaRelatorio = class(TForm)
    pnl1: TPanel;
    pnl3: TPanel;
    pnl4: TPanel;
    pnl6: TPanel;
    pnl5: TPanel;
    ScrollBox1: TScrollBox;
    pnl12: TPanel;
    pnl13: TPanel;
    chklstOrdenacao: TCheckListBox;
    pnl14: TPanel;
    btnBtLimpar: TBitBtn;
    BtGerar: TBitBtn;
    QPadraoPesquisaRelatorio: TQuery;
    dsPadraoPesquisaRelatorio: TDataSource;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure dbgConsultaDblClick(Sender: TObject);
    procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
    procedure BtGerarClick(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FModeloPesquisaRelatorio: TFModeloPesquisaRelatorio;

implementation

{$R *.dfm}


procedure TFModeloPesquisaRelatorio.FormCreate(Sender: TObject);
begin
  DPTOCriaPesquisaRelatorio(qPadraoPesquisaRelatorio, chklstOrdenacao, ScrollBox1);
  //
  acertaApontamentoBanco(Self);
  //
end;

procedure TFModeloPesquisaRelatorio.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  //TForm(Self).Hint := qPadraoPesquisaRelatorio.fieldByName(TForm(Self).Hint).AsString;
end;

procedure TFModeloPesquisaRelatorio.dbgConsultaDblClick(Sender: TObject);
begin
  TForm(Self).Close;
end;


procedure TFModeloPesquisaRelatorio.FormShortCut(var Msg: TWMKey;
  var Handled: Boolean);
begin

        if Msg.CharCode = VK_F5 then BtGerar.Click; // LOCALIZAR - F5
//        if Msg.CharCode = VK_F12 then BtLimpar.Click;   // LIMPAR - F12



end;

procedure TFModeloPesquisaRelatorio.BtGerarClick(Sender: TObject);
begin
  DPTOPesquisarRelatorio(qPadraoPesquisaRelatorio,chklstOrdenacao, ScrollBox1);
end;

end.
